All Questions
5 questions
0votes
1answer
940views
Dependency Injection for dynamic objects
I am learning about Dependency Injection and I have been recently implementing the following classes for an app that executes commands over ssh using Python. I am confused about whether I am using it ...
1vote
2answers
147views
Choosing between DI (without container) and Composition
I'm working on a classes that are designed to read a defined file format; said format is comprised of 2 separate files (FileA and FileB). For ease of use, the format is referred to as the FileA format,...
0votes
1answer
171views
Mixing IoC container use with "poor mans" DI
I'm finding the use of IoC containers to be quite the shift in my application design, and its for the better. I'm using a framework called injector that aims to mimic (albeit not entirely) the Guice ...
0votes
1answer
171views
Dependency Injection (DI) and Dependency Inversion Principle (DIP) for built-in functions and external libraries
Question I apologize if this question has already been posted. I tried searching but I couldn't find the answer. I often find myself trying to use DI and DIP where I need to open a file or a socket. ...
11votes
1answer
2kviews
Using Python's Method Resolution Order for Dependency Injection - is this bad?
I watched Raymond Hettinger's Pycon talk "Super Considered Super" and learned a little bit about Python's MRO (Method Resolution Order) which linearises a classes "parent" classes in a deterministic ...